<?php
include 'view/all.php';
/*
 * This is right part of page
 */


$q1 = mysql_query("select * from baby_mother_last_period where bid = '".$_COOKIE['bid']."' ");
while ($r2 = mysql_fetch_array($q1)) {
    $sd = $r2['last_menstrual_period'];
    $sd = date('m-d-Y', strtotime($sd));   
    $stm = date('m,d,Y',  strtotime($sd));
    $dd = $r2['due_date'];
    $dd = date('m-d-Y', strtotime($dd));
    $endm = date('m,d,Y',  strtotime($dd));

    $nm = date('m-d-Y', strtotime('+30 days', strtotime($sd)));
    $n1 = date('m,d,Y', strtotime('+30 days', strtotime($sd)));
    $nm2 = date('m-d-Y', strtotime('+60 days', strtotime($sd)));
    $n2 = date('m,d,Y', strtotime('+60 days', strtotime($sd)));
    $nm3 = date('m-d-Y', strtotime('+90 days', strtotime($sd)));
    $n3 = date('m,d,Y', strtotime('+90 days', strtotime($sd)));
    $nm4 = date('m-d-Y', strtotime('+120 days', strtotime($sd)));
    $n4 = date('m,d,Y', strtotime('+120 days', strtotime($sd)));
    $nm5 = date('m-d-Y', strtotime('+150 days', strtotime($sd)));
    $n5 = date('m,d,Y', strtotime('+150 days', strtotime($sd)));
    $nm6 = date('m-d-Y', strtotime('+180 days', strtotime($sd)));
    $n6 = date('m,d,Y', strtotime('+180 days', strtotime($sd)));
    $nm7 = date('m-d-Y', strtotime('+210 days', strtotime($sd)));
    $n7 = date('m,d,Y', strtotime('+210 days', strtotime($sd)));
    $nm8 = date('m-d-Y', strtotime('+240 days', strtotime($sd)));
    $n8 = date('m,d,Y', strtotime('+240 days', strtotime($sd)));
}
?>
<style>
    .Highlighted a{
        background-color : #F6358A !important;
        background-image :none !important;
        color: White !important;
        font-weight:bold !important;
        font-size: 10pt;
    }
</style>
<script>
    $(function() {

        var SelectedDates = {};
		
        SelectedDates[new Date("<?= $sd ?>")] = new Date("<?= $sd ?>");
        SelectedDates[new Date("<?= $nm ?>")] = new Date("<?= $nm ?>");
        SelectedDates[new Date("<?= $nm2 ?>")] = new Date("<?= $nm2 ?>");
        SelectedDates[new Date("<?= $nm3 ?>")] = new Date("<?= $nm3 ?>");
        SelectedDates[new Date("<?= $nm4 ?>")] = new Date("<?= $nm4 ?>");
        SelectedDates[new Date("<?= $nm5 ?>")] = new Date("<?= $nm5 ?>");
        SelectedDates[new Date("<?= $nm6 ?>")] = new Date("<?= $nm6 ?>");
        SelectedDates[new Date("<?= $nm7 ?>")] = new Date("<?= $nm7 ?>");
        SelectedDates[new Date("<?= $nm8 ?>")] = new Date("<?= $nm8 ?>");
        SelectedDates[new Date("<?= $dd ?>")] = new Date("<?= $dd ?>");
        
        //for firefox
        SelectedDates[new Date("<?= $stm ?>")] = new Date("<?= $stm ?>");
        SelectedDates[new Date("<?= $endm ?>")] = new Date("<?= $endm ?>");
        SelectedDates[new Date("<?= $n1 ?>")] = new Date("<?= $n1 ?>");
        SelectedDates[new Date("<?= $n2 ?>")] = new Date("<?= $n2 ?>");
        SelectedDates[new Date("<?= $n3 ?>")] = new Date("<?= $n3 ?>");
        SelectedDates[new Date("<?= $n4 ?>")] = new Date("<?= $n4 ?>");
        SelectedDates[new Date("<?= $n5 ?>")] = new Date("<?= $n5 ?>");
        SelectedDates[new Date("<?= $n6 ?>")] = new Date("<?= $n6 ?>");
        SelectedDates[new Date("<?= $n7 ?>")] = new Date("<?= $n7 ?>");
        SelectedDates[new Date("<?= $n8 ?>")] = new Date("<?= $n8 ?>");
        
        // SelectedDates[new Date('06/06/2012')] = new Date('06/06/2012');
        // SelectedDates[new Date('06/07/2012')] = new Date('06/07/2012');

		
		


        $( "#datepicker" ).datepicker({
            dateFormat : 'mm-dd-yy',
            beforeShowDay: function(date) {
					
                var Highlight = SelectedDates[date];
                if (Highlight) {
                    return [true, "Highlighted", Highlight];
                }
                else {
                    return [true, 'shitt.', ''];
					
                }
            },

			
            onSelect:function(date)
            {                
                if(date == "<?php echo $sd; ?>" )
                {$("#dialog-start").dialog({modal: true});}
                else if (date=="<?php echo $nm; ?>")
                { $("#dialog-two").dialog({modal:true,height:'auto',width:'auto'});}
                else if (date=="<?php echo $nm2; ?>")
                { $("#dialog-three").dialog({modal:true,height:'auto',width:'auto'});}
                else if (date=="<?php echo $nm3; ?>")
                { $("#dialog-four").dialog({modal:true,height:'auto',width:'auto'});}
                else if (date=="<?php echo $nm4; ?>")
                { $("#dialog-five").dialog({modal:true,height:'auto',width:'auto'});}
                else if (date=="<?php echo $nm5; ?>")
                { $("#dialog-six").dialog({modal:true,height:'auto',width:'auto'});}
                else if (date=="<?php echo $nm6; ?>")
                { $("#dialog-seven").dialog({modal:true,height:'auto',width:'auto'});}
                else if (date=="<?php echo $nm7; ?>")
                { $("#dialog-eight").dialog({modal:true,height:'auto',width:'auto'});}
                else if (date=="<?php echo $nm8; ?>")
                { $("#dialog-nine").dialog({modal:true,height:'auto',width:'auto'});}
                else if (date=="<?php echo $dd; ?>")
                { $("#dialog-last").dialog({modal:true,height:'auto',width:'auto'});}
                
                                                                		           
            }
        });
    });
</script>



<div class="right_menu">
    <!--                    <div class="float_left">-->
    <div>
        <?php if(mysql_num_rows($getbaby)==0){ ?>
        <div class="right_logo">
            <a href="http://<?=$_SERVER['HTTP_HOST']?>/salusmain/me/upgrade_to_baby"><img src="http://<?=$_SERVER['HTTP_HOST']?>/salusme/include/images/baby.png" height="80%" width="80%" title="Upgrade to Salusbaby" /> </a>
        </div>
        <?php } ?>
        <div class="right_logo">
            <img src="http://<?=$_SERVER['HTTP_HOST']?>/salusme/include/images/pets.jpg" height="80%" width="80%" />
        </div>
        <div class="right_logo">
            <img src="http://<?=$_SERVER['HTTP_HOST']?>/salusme/include/images/senior.jpg" height="80%" width="80%" />
        </div>
        <div class="right_logo">
            <div class="salus_sport_logo logo"></div>
        </div>
    </div>

    <div>
        <div style="border-bottom: 2px solid #898989">
            <div class="news_title">MEDICINE:</div>
            <div  class="news_desc">Discovered two genes involved in high blood pressure</div>
        </div>
        <div style="border-bottom: 2px solid #898989">
            <div class="news_title">BRAIN:</div>
            <div  class="news_desc">A smoker of ten continuous after diagnosis of cancer oncology</div>
        </div>
    </div>
    <div>
        <div class="news_title" >TODO(s)</div>        
    </div>
    <div>
        <div id="datepicker" style="margin: 5px 0px 0px 1px; font-size: 8.7px; "></div>

    </div>

    <!--                    </div>-->
</div><div class="clear"></div>


<div id="dialog-start" title="Last Menstual Date " style="display:none;">
    <p>This is start date</p>
    <div class="ui-widget">
        <div class="ui-state-highlight ui-corner-all news_desc " style="margin-top: 20px; padding: 0 .7em; font-size: 11px;">
            <p><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
                <strong>Note : </strong> You can make test within this month on any day.</p>
        </div>
    </div>
</div>

<div id="dialog-two" title="Tests for 2&deg; month" style="display : none;" >	
    <p>This is your 2nd month.
    <ol>
        <?php
        $q2 = mysql_query("select * from baby_tests where test_month =2") or die(mysql_error());
        while ($row2 = mysql_fetch_array($q2)) {
            echo '<li>' . $row2['test_name'] . '</li>';
        }
        ?>
    </ol>
     <div class="ui-widget">
        <div class="ui-state-highlight ui-corner-all news_desc " style="margin-top: 20px; padding: 0 .7em; font-size: 11px;">
            <p><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
                <strong>Note : </strong> You can make test within this month on any day.</p>
        </div>
    </div>
</p>
</div>
<div id="dialog-three" title="Tests for 3&deg; month" style="display : none;" >	
    <p>This is your 3&deg; month.
    <ol>
        <?php
        $q3 = mysql_query("select * from baby_tests where test_month =3") or die(mysql_error());
        while ($row3 = mysql_fetch_array($q3)) {
            echo '<li>' . $row3['test_name'] . '</li>';
        }
        ?>
    </ol>
     <div class="ui-widget">
        <div class="ui-state-highlight ui-corner-all news_desc " style="margin-top: 20px; padding: 0 .7em; font-size: 11px;">
            <p><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
                <strong>Note : </strong> You can make test within this month on any day.</p>
        </div>
    </div>
</p>
</div>
<div id="dialog-four" title="Tests for 4&deg; month" style="display : none;" >	
    <p>This is your 4&deg; month.
    <ol>
        <?php
        $q4 = mysql_query("select * from baby_tests where test_month =4") or die(mysql_error());
        while ($row4 = mysql_fetch_array($q4)) {
            echo '<li>' . $row4['test_name'] . '</li>';
        }
        ?>
    </ol>
     <div class="ui-widget">
        <div class="ui-state-highlight ui-corner-all news_desc " style="margin-top: 20px; padding: 0 .7em; font-size: 11px;">
            <p><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
                <strong>Note : </strong> You can make test within this month on any day.</p>
        </div>
    </div>
</p>
</div>

<div id="dialog-five" title="Tests for 5&deg; month" style="display : none;" >	
    <p>This is your 5th month.
    <ol>
        <?php
        $q5 = mysql_query("select * from baby_tests where test_month =5") or die(mysql_error());
        while ($row5 = mysql_fetch_array($q5)) {
            echo '<li>' . $row5['test_name'] . '</li>';
        }
        ?>
    </ol>
     <div class="ui-widget">
        <div class="ui-state-highlight ui-corner-all news_desc " style="margin-top: 20px; padding: 0 .7em; font-size: 11px;">
            <p><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
                <strong>Note : </strong> You can make test within this month on any day.</p>
        </div>
    </div>
</p>
</div>

<div id="dialog-six" title="Tests for 6&deg; month" style="display : none;" >	
    <p>This is your 6&deg; month.
    <ol>
        <?php
        $q6 = mysql_query("select * from baby_tests where test_month =6") or die(mysql_error());
        while ($row6 = mysql_fetch_array($q6)) {
            echo '<li>' . $row6['test_name'] . '</li>';
        }
        ?>
    </ol>
     <div class="ui-widget">
        <div class="ui-state-highlight ui-corner-all news_desc " style="margin-top: 20px; padding: 0 .7em; font-size: 11px;">
            <p><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
                <strong>Note : </strong> You can make test within this month on any day.</p>
        </div>
    </div>
</p>
</div>

<div id="dialog-seven" title="Tests for 7&deg; month" style="display : none;" >	
    <p>This is your 7&deg; month.
    <ol>
        <?php
        $q7 = mysql_query("select * from baby_tests where test_month =7") or die(mysql_error());
        while ($row7 = mysql_fetch_array($q7)) {
            echo '<li>' . $row7['test_name'] . '</li>';
        }
        ?>
    </ol>
     <div class="ui-widget">
        <div class="ui-state-highlight ui-corner-all news_desc " style="margin-top: 20px; padding: 0 .7em; font-size: 11px;">
            <p><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
                <strong>Note : </strong> You can make test within this month on any day.</p>
        </div>
    </div>
</p>
</div>

<div id="dialog-eight" title="Tests for 8&deg; month" style="display : none;" >	
    <p>This is your 8th month.
    <ol>
        <?php
        $q8 = mysql_query("select * from baby_tests where test_month =8") or die(mysql_error());
        while ($row8 = mysql_fetch_array($q8)) {
            echo '<li>' . $row8['test_name'] . '</li>';
        }
        ?>
    </ol>
     <div class="ui-widget">
        <div class="ui-state-highlight ui-corner-all news_desc " style="margin-top: 20px; padding: 0 .7em; font-size: 11px;">
            <p><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
                <strong>Note : </strong> You can make test within this month on any day.</p>
        </div>
    </div>
</p>
</div>

<div id="dialog-nine" title="Tests for 9&deg; month" style="display : none;" >	
    <p>This is your 9th month.
    <ol>
        <?php
        $q9 = mysql_query("select * from baby_tests where test_month =9") or die(mysql_error());
        while ($row9 = mysql_fetch_array($q9)) {
            echo '<li>' . $row9['test_name'] . '</li>';
        }
        ?>
    </ol>
     <div class="ui-widget">
        <div class="ui-state-highlight ui-corner-all news_desc " style="margin-top: 20px; padding: 0 .7em; font-size: 11px;">
            <p><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
                <strong>Note : </strong> You can make test within this month on any day.</p>
        </div>
    </div>
</p>
</div>

<div id="dialog-last" title="Tests for 10&deg; month" style="display : none;" >	
    <p>This is your last month. </p>
</div>

